home *** CD-ROM | disk | FTP | other *** search
/ FishMarket 1.0 / FishMarket v1.0.iso / fishies / 076-100 / disk_084 / ed / append.c < prev    next >
C/C++ Source or Header  |  1992-05-06  |  713b  |  43 lines

  1. /*
  2.  * Copyright 1987 Brian Beattie Rights Reserved.
  3.  *
  4.  * Permission to copy and/or distribute granted under the
  5.  * following conditions:
  6.  *
  7.  * 1). No charge may be made other than resonable charges
  8.  *    for reproduction.
  9.  *
  10.  * 2). This notice must remain intact.
  11.  *
  12.  * 3). No further restrictions may be added.
  13.  *
  14.  */
  15. #include <stdio.h>
  16. #include "tools.h"
  17. #include "ed.h"
  18.  
  19. append(line, glob)
  20. int    line, glob;
  21. {
  22.     int    stat;
  23.     char    lin[MAXLINE];
  24.  
  25.     if(glob)
  26.         return(ERR);
  27.     curln = line;
  28.     while(1)
  29.     {
  30.         if(nflg)
  31.             fprintf(stdout,"%6d. ",curln+1);
  32.  
  33.         if(fgets(lin, MAXLINE, stdin) == NULL)
  34.             return( EOF );
  35.         if(lin[0] == '.' && lin[1] == '\n')
  36.             return(0);
  37.         stat = ins(lin);
  38.         if(stat < 0)
  39.             return( ERR );
  40.         
  41.     }
  42. }
  43.